package a.f.l;

import a.c.e;
import a.c.j;
import a.c.k;
import a.c.m;
import a.c.x;
import a.c.z;
import a.d.n;
import a.f.o;
import a.f.wc;
import a.f.zc;
import a.i.lb;

import java.awt.geom.Rectangle2D;
import java.awt.geom.Rectangle2D.Double;
import java.util.*;

class bb
{
  private static final byte a = 0;
  private static final byte b = 1;
  private static final byte c = 2;
  private static final byte d = 3;
  private static final byte e = 4;
  private final double f;
  private final b g;
  private boolean i;
  private double j;
  private int k;
  private Rectangle2D l;
  private Rectangle2D m;
  
  bb(b paramb)
  {
    this.g = paramb;
    this.f = 0.4D;
    this.i = false;
  }
  
  int a()
  {
    return this.k;
  }
  
  void a(int paramInt)
  {
    this.k = paramInt;
  }
  
  double c()
  {
    return this.j;
  }
  
  void a(double paramDouble)
  {
    this.j = paramDouble;
  }
  
  boolean d()
  {
    return this.i;
  }
  
  void a(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  List a(o paramo, a.c.w paramw)
  {
    int n = g.Cc;
    b(paramo, paramw);
    boolean[] arrayOfBoolean = { true, false };
    List[] arrayOfList1 = { new z(), new z() };
    a(paramo, arrayOfBoolean[0], arrayOfList1[0]);
    a(paramo, arrayOfBoolean[1], arrayOfList1[1]);
    List[] arrayOfList2 = { new z(), new z() };
    a(arrayOfList1[0], arrayOfList2[0], arrayOfBoolean[0], this.g.e());
    a(arrayOfList1[1], arrayOfList2[1], arrayOfBoolean[1], this.g.e());
    if (n == 0) {
      if (a(arrayOfList2))
      {
        if (n != 0) {
          break label208;
        }
        if (this.g.e())
        {
          a(arrayOfList1[0], arrayOfList2[0], arrayOfBoolean[0], false);
          a(arrayOfList1[1], arrayOfList2[1], arrayOfBoolean[1], false);
        }
      }
    }
    if (a(arrayOfList2))
    {
      label208:
      kb localkb = new kb(this.l.getCenterX() - 10.0D, this.l.getCenterY(), this.l.getCenterX() + 10.0D, this.l.getCenterY());
      arrayOfList2[0].add(new ob(localkb, true, this.l));
    }
    return a(paramo, arrayOfList2, paramw);
  }
  
  List a(o paramo, List[] paramArrayOfList)
  {
    int i3 = g.Cc;
    int i2 = g.Bc;
    ArrayList localArrayList = new ArrayList(2 * this.k);
    boolean[] arrayOfBoolean = { true, false };
    int n = 0;
    label42:
    if (n < arrayOfBoolean.length) {}
    label232:
    label242:
    while (i3 != 0)
    {
      if (i3 == 0)
      {
        if (!paramArrayOfList[n].isEmpty()) {
          Collections.sort(paramArrayOfList[n], new Comparator()
          {
            public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
            {
              return -b.b(((n)paramAnonymousObject1).h(), ((n)paramAnonymousObject2).h());
            }
          });
        }
      }
      else
      {
        int i1 = 0;
        Iterator localIterator = paramArrayOfList[n].iterator();
        do
        {
          if (!localIterator.hasNext()) {
            break label232;
          }
          n localn = (n)localIterator.next();
          if (i2 != 0) {
            break;
          }
          if (i1 > 0)
          {
            if (i3 != 0) {
              break label242;
            }
            if ((localn.h() < this.j) || (i1 >= this.k)) {
              break label232;
            }
          }
          a.d.w localw1 = localn.d();
          a.d.w localw2 = localn.e();
          ob localob = new ob(new kb(localw1.a(), localw1.b(), localw2.a(), localw2.b()));
          localob.a(paramo);
          localArrayList.add(localob);
          i1++;
        } while (i2 == 0);
      }
      n++;
      if (i3 != 0) {
        break label42;
      }
      if (i2 == 0) {
        break;
      }
    }
    return localArrayList;
  }
  
  private void b(o paramo, a.c.w paramw)
  {
    this.m = wc.a(paramo, paramw);
    int n = Math.max(this.g.f(), this.g.g());
    if (g.Cc == 0) {}
    double d1 = this.g.e() ? n + this.g.d() : 2 * n;
    this.l = new Rectangle2D.Double(this.m.getX() - d1, this.m.getY() - d1, this.m.getWidth() + 2.0D * d1, this.m.getHeight() + 2.0D * d1);
  }
  
  private void a(o paramo, boolean paramBoolean, List paramList)
  {
    g_ local7 = new g_(paramList)
    {
      private final List val$rectangles;
      
      protected void b(double paramAnonymousDouble1, double paramAnonymousDouble2, double paramAnonymousDouble3, double paramAnonymousDouble4)
      {
        this.val$rectangles.add(new Rectangle2D.Double(paramAnonymousDouble1, paramAnonymousDouble2, paramAnonymousDouble3, paramAnonymousDouble4));
      }
    };
    local7.a(paramo, paramBoolean, this.l, paramo.v(), paramo.w());
  }
  
  private void a(Collection paramCollection, List paramList, boolean paramBoolean1, boolean paramBoolean2)
  {
    int i1 = g.Cc;
    int n = g.Bc;
    Iterator localIterator = paramCollection.iterator();
    do
    {
      do
      {
        Rectangle2D localRectangle2D;
        kb localkb;
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          localRectangle2D = (Rectangle2D)localIterator.next();
          localkb = a(localRectangle2D, (byte)0, paramBoolean1, paramBoolean2, this.g.c().I(), this.g.d());
        } while (localkb == null);
        if (i1 == 0) {}
        boolean bool = !this.m.intersects(localRectangle2D);
        paramList.add(new ob(localkb, bool, localRectangle2D));
      } while (i1 != 0);
    } while (n == 0);
  }
  
  private List a(o paramo, List[] paramArrayOfList, a.c.w paramw)
  {
    int i4 = g.Cc;
    int i3 = g.Bc;
    x localx = paramo.B();
    ArrayList localArrayList1 = new ArrayList(2 * this.k);
    int n = 0;
    label176:
    label184:
    do
    {
      if (n >= paramArrayOfList.length) {
        break;
      }
      List localList = paramArrayOfList[n];
      if ((i4 == 0) && (i3 != 0)) {
        break label241;
      }
      if (localList.size() != 0)
      {
        ArrayList localArrayList2 = a(localList);
        a(paramo, localArrayList2, paramw, localx);
        int i1 = 0;
        int i2 = 0;
        do
        {
          do
          {
            if (i2 >= localArrayList2.size()) {
              break label184;
            }
            ob localob = (ob)localArrayList2.get(i2);
            if (i3 != 0) {
              break;
            }
            if (i1 < this.k) {
              if (i4 == 0)
              {
                if (a(localArrayList1, localob))
                {
                  localArrayList1.add(localob);
                  i1++;
                }
              }
              else
              {
                if (i4 != 0) {
                  continue;
                }
                if (i3 == 0) {
                  break label176;
                }
              }
            }
            paramo.a(localob.g());
            i2++;
          } while (i3 == 0);
        } while (i4 != 0);
        if (i4 != 0) {
          continue;
        }
        if (i1 == 0) {
          localArrayList1.add(localArrayList2.get(0));
        }
      }
      n++;
    } while (i3 == 0);
    Collections.sort(localArrayList1, a(localx));
    if (i4 == 0) {
      paramo.a(localx);
    }
    label241:
    return localArrayList1;
  }
  
  private ArrayList a(List paramList)
  {
    int i1 = g.Cc;
    int n = g.Bc;
    Collections.sort(paramList, new Comparator()
    {
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        return -b.b(((ob)paramAnonymousObject1).d(), ((ob)paramAnonymousObject2).d());
      }
    });
    ArrayList localArrayList = new ArrayList(paramList.size());
    Iterator localIterator = paramList.iterator();
    if (localIterator.hasNext()) {}
    while (i1 != 0)
    {
      ob localob = (ob)localIterator.next();
      double d1 = localob.d();
      if (i1 == 0)
      {
        if (d1 <= this.j)
        {
          if (i1 != 0) {
            break label115;
          }
          if (!localArrayList.isEmpty()) {}
        }
        else
        {
          localArrayList.add(localob);
        }
      }
      else {
        if (n == 0) {
          break;
        }
      }
    }
    label115:
    return localArrayList;
  }
  
  private void a(o paramo, List paramList, a.c.w paramw, x paramx)
  {
    int i1 = g.Cc;
    int n = g.Bc;
    if (paramList.isEmpty()) {
      return;
    }
    x localx = paramo.B();
    paramw.h();
    double d1;
    double d2;
    do
    {
      while (n == 0)
      {
        if (!paramw.e()) {
          break;
        }
        localx.a(paramw.d(), a(paramo.d(paramw.d())));
        paramw.f();
      }
      d1 = this.f * this.l.getWidth();
      d2 = this.f * this.l.getHeight();
    } while (i1 != 0);
    Iterator localIterator = paramList.iterator();
    if (localIterator.hasNext()) {}
    label283:
    label285:
    do
    {
      ob localob = (ob)localIterator.next();
      localob.a(paramo);
      double d3 = 0.0D;
      if (n != 0) {
        return;
      }
      paramw.h();
      if (paramw.e()) {}
      while (i1 != 0)
      {
        Rectangle2D localRectangle2D = (Rectangle2D)localx.get(paramw.d());
        d3 += Math.min(Math.abs(a(localob.c(), localRectangle2D, true)), d1);
        d3 += Math.min(Math.abs(a(localob.c(), localRectangle2D, false)), d2);
        paramw.f();
        if (i1 != 0) {
          break label285;
        }
        if (n != 0) {
          break label283;
        }
        if (n == 0) {
          break;
        }
      }
      paramx.a(localob.g(), Math.floor(d3 + 0.5D));
      if (n == 0) {
        break;
      }
      paramo.a(localx);
    } while (i1 != 0);
    Collections.sort(paramList, a(paramx));
  }
  
  private boolean a(Collection paramCollection, ob paramob)
  {
    int i1 = g.Cc;
    int n = g.Bc;
    Iterator localIterator = paramCollection.iterator();
    while (localIterator.hasNext())
    {
      ob localob = (ob)localIterator.next();
      if (localob.a() == paramob.a())
      {
        if ((i1 != 0) || (n != 0)) {
          break label119;
        }
        if ((localob.e() - 2.0D * this.g.g() < paramob.e()) && ((i1 != 0) || (paramob.e() < localob.e() + 2.0D * this.g.g()))) {
          return false;
        }
      }
    }
    label119:
    return true;
  }
  
  private Comparator a(x paramx)
  {
    new Comparator()
    {
      private final x val$totalDistances;
      
      public int compare(Object paramAnonymousObject1, Object paramAnonymousObject2)
      {
        int j = g.Cc;
        ob localob1 = (ob)paramAnonymousObject1;
        ob localob2 = (ob)paramAnonymousObject2;
        int i = b.b(this.val$totalDistances.getDouble(localob1.g()), this.val$totalDistances.getDouble(localob2.g()));
        if (j == 0) {
          if (i != 0) {
            return i;
          }
        }
        if (j == 0) {
          if (localob1.f() != localob2.f())
          {
            if (j == 0) {}
            return localob2.f() ? -1 : 1;
          }
        }
        return -b.b(localob1.d(), localob2.d());
      }
    };
  }
  
  private void c(o paramo, List[] paramArrayOfList)
  {
    int i2 = g.Cc;
    int i1 = g.Bc;
    j localj = (j)paramo.c("y.layout.router.BusRouter.DEBUG_INFO_DPKEY");
    int n = 0;
    label138:
    label140:
    do
    {
      if (n >= paramArrayOfList.length) {
        break;
      }
      List localList = paramArrayOfList[n];
      Iterator localIterator = localList.iterator();
      do
      {
        if (!localIterator.hasNext()) {
          break;
        }
        Rectangle2D localRectangle2D = (Rectangle2D)localIterator.next();
        e locale = paramo.i();
        paramo.b(locale, localRectangle2D.getWidth(), localRectangle2D.getHeight());
        paramo.c(locale, localRectangle2D.getX(), localRectangle2D.getY());
        localj.a(locale, "bbRectangle");
        if (i2 != 0) {
          break label140;
        }
        if (i1 != 0) {
          break label138;
        }
      } while (i1 == 0);
      if (i2 == 0) {
        n++;
      }
    } while (i1 == 0);
  }
  
  private static double a(kb paramkb1, kb paramkb2, boolean paramBoolean)
  {
    double d1 = paramBoolean ? paramkb1.b() : paramkb1.c();
    double d2 = paramBoolean ? paramkb1.e() : paramkb1.f();
    double d3 = Math.min(d1, d2);
    double d4 = Math.max(d1, d2);
    double d5 = paramBoolean ? paramkb2.b() : paramkb2.c();
    double d6 = paramBoolean ? paramkb2.e() : paramkb2.f();
    double d7 = Math.min(d5, d6);
    double d8 = Math.max(d5, d6);
    return a(d3, d4, d7, d8);
  }
  
  private static double a(Rectangle2D paramRectangle2D1, Rectangle2D paramRectangle2D2, boolean paramBoolean)
  {
    double d1 = paramBoolean ? paramRectangle2D1.getX() : paramRectangle2D1.getY();
    double d2 = paramBoolean ? paramRectangle2D1.getX() + paramRectangle2D1.getWidth() : paramRectangle2D1.getY() + paramRectangle2D1.getHeight();
    double d3 = paramBoolean ? paramRectangle2D2.getX() : paramRectangle2D2.getY();
    double d4 = paramBoolean ? paramRectangle2D2.getX() + paramRectangle2D2.getWidth() : paramRectangle2D2.getY() + paramRectangle2D2.getHeight();
    return a(d1, d2, d3, d4);
  }
  
  private static double a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
  {
    int n = g.Cc;
    if (n == 0)
    {
      if (paramDouble4 < paramDouble1) {
        return paramDouble4 - paramDouble1;
      }
      if (n != 0) {}
    }
    else if (paramDouble2 < paramDouble3)
    {
      return paramDouble3 - paramDouble2;
    }
    return 0.0D;
  }
  
  static kb a(Rectangle2D paramRectangle2D, byte paramByte, boolean paramBoolean1, boolean paramBoolean2, a.d.w paramw, int paramInt)
  {
    int i2 = g.Cc;
    int i1 = g.Bc;
    double d1;
    boolean bool;
    switch (paramByte)
    {
    case 1: 
      d1 = Math.floor(paramRectangle2D.getMaxX());
      bool = false;
      if (i2 == 0) {
        if (i1 == 0) {
          break;
        }
      }
      break;
    case 2: 
      d1 = Math.floor(paramRectangle2D.getMaxY());
      bool = true;
      if (i2 == 0) {
        if (i1 == 0) {
          break;
        }
      }
      break;
    case 3: 
      d1 = Math.ceil(paramRectangle2D.getMinX());
      bool = false;
      if (i2 == 0) {
        if (i1 == 0) {
          break;
        }
      }
      break;
    case 4: 
      d1 = Math.ceil(paramRectangle2D.getMinY());
      bool = true;
      if (i2 == 0) {
        if (i1 == 0) {
          break;
        }
      }
      break;
    case 0: 
      bool = paramBoolean1;
      d1 = paramBoolean1 ? Math.ceil(paramRectangle2D.getCenterY()) : Math.ceil(paramRectangle2D.getCenterX());
      if (i2 == 0) {
        if (i1 == 0) {
          break;
        }
      }
      break;
    default: 
      return null;
    }
    double d2 = bool ? Math.ceil(paramRectangle2D.getMinX()) : Math.ceil(paramRectangle2D.getMinY());
    double d3 = bool ? Math.floor(paramRectangle2D.getMaxX()) : Math.floor(paramRectangle2D.getMaxY());
    if (i2 == 0) {
      if (paramBoolean2)
      {
        int n = (int)(bool ? paramw.a() : paramw.b());
        double d4 = bool ? paramRectangle2D.getMinY() : paramRectangle2D.getMinX();
        double d5 = bool ? paramRectangle2D.getMaxY() : paramRectangle2D.getMaxX();
        d1 = b.a(d1, n, paramInt, d4, d5);
        d2 = b.a(d2, n, paramInt, true);
        d3 = b.a(d3, n, paramInt, false);
        if (((i2 != 0) || (!Double.isNaN(d1))) && ((i2 != 0) || (!Double.isNaN(d2))) && ((i2 != 0) || (!Double.isNaN(d3))))
        {
          if (i2 != 0) {
            break label379;
          }
          if (d3 >= d2) {}
        }
        else
        {
          return null;
        }
      }
    }
    label379:
    return bool ? new kb(d2, d1, d3, d1) : new kb(d1, d2, d1, d3);
  }
  
  static Rectangle2D a(zc paramzc)
  {
    return new Rectangle2D.Double(paramzc.a(), paramzc.b(), paramzc.c(), paramzc.d());
  }
  
  static boolean a(Collection[] paramArrayOfCollection)
  {
    int i2 = g.Cc;
    int i1 = g.Bc;
    if (paramArrayOfCollection == null) {
      return true;
    }
    do
    {
      for (int n = 0; i1 == 0; n++)
      {
        if (n >= paramArrayOfCollection.length) {
          break;
        }
        if (i1 != 0) {
          break label51;
        }
        if (paramArrayOfCollection[n].isEmpty()) {
          return true;
        }
      }
    } while (i2 != 0);
    label51:
    return false;
  }
  
  private static class e_
    implements Comparable
  {
    private final e_ a;
    private final double b;
    private final double d;
    private final double e;
    
    private e_(double paramDouble, e_ parame_)
    {
      this.a = parame_;
      this.b = paramDouble;
      this.d = parame_.d;
      this.e = parame_.e;
    }
    
    private e_(double paramDouble1, double paramDouble2, double paramDouble3)
    {
      this.a = null;
      this.b = paramDouble1;
      this.d = paramDouble2;
      this.e = paramDouble3;
    }
    
    private boolean a()
    {
      return this.a == null;
    }
    
    public int compareTo(Object paramObject)
    {
      int j = g.Cc;
      e_ locale_ = (e_)paramObject;
      int i = b.b(this.b, locale_.b);
      if (j == 0) {
        if (i != 0) {
          return i;
        }
      }
      if (j == 0) {
        if (a() != locale_.a())
        {
          if (j == 0) {}
          return a() ? 1 : -1;
        }
      }
      return 0;
    }
    
    public String toString()
    {
      return "SweepEvent{open=" + a() + ", c=" + this.b + ", min=" + this.d + ", max=" + this.e + '}';
    }
    
    e_(double paramDouble1, double paramDouble2, double paramDouble3, bb.0 param0)
    {
      this(paramDouble1, paramDouble2, paramDouble3);
    }
    
    e_(double paramDouble, e_ parame_, bb.0 param0)
    {
      this(paramDouble, parame_);
    }
  }
  
  private static class d_
    implements Comparable
  {
    final double a;
    final double c;
    
    private d_(double paramDouble1, double paramDouble2)
    {
      this.a = paramDouble1;
      this.c = paramDouble2;
    }
    
    public int compareTo(Object paramObject)
    {
      return l.a(this.a, ((d_)paramObject).a);
    }
    
    public String toString()
    {
      return "SweepEntry{coordinate=" + this.a + ", value=" + this.c + '}';
    }
    
    d_(double paramDouble1, double paramDouble2, bb.0 param0)
    {
      this(paramDouble1, paramDouble2);
    }
  }
  
  private static class f_
    implements Comparable
  {
    final double a;
    final boolean c;
    
    private f_(double paramDouble, boolean paramBoolean)
    {
      this.a = paramDouble;
      this.c = paramBoolean;
    }
    
    public int compareTo(Object paramObject)
    {
      return l.a(this.a, ((f_)paramObject).a);
    }
    
    f_(double paramDouble, boolean paramBoolean, bb.0 param0)
    {
      this(paramDouble, paramBoolean);
    }
  }
  
  private abstract class g_
  {
    private Rectangle2D a;
    private ArrayList b;
    private boolean c;
    
    protected g_() {}
    
    private void a(o paramo, boolean paramBoolean, Rectangle2D paramRectangle2D, a.c.w paramw, m paramm)
    {
      int m = g.Cc;
      int k = g.Bc;
      paramw.h();
      paramm.h();
      if (m == 0)
      {
        if (paramw.k() == 0)
        {
          if (m != 0) {
            break label112;
          }
          if (paramm.k() == 0) {
            return;
          }
        }
        this.c = paramBoolean;
        this.a = paramRectangle2D;
        this.b = new ArrayList((2 * paramw.k() + paramm.k() + 2) * 2);
        a(paramo, paramw);
        a(paramo, paramm);
      }
      if (paramBoolean)
      {
        label112:
        localObject1 = new bb.e_(paramRectangle2D.getMaxX() + 1.0D, paramRectangle2D.getMinY(), paramRectangle2D.getMaxY(), null);
        this.b.add(localObject1);
        this.b.add(new bb.e_(paramRectangle2D.getMinX() - 1.0D, (bb.e_)localObject1, null));
        if (m != 0) {
          break label248;
        }
        if (k == 0) {}
      }
      else
      {
        localObject1 = new bb.e_(paramRectangle2D.getMaxY() + 1.0D, paramRectangle2D.getMinX(), paramRectangle2D.getMaxX(), null);
        this.b.add(localObject1);
        this.b.add(new bb.e_(paramRectangle2D.getMinY() - 1.0D, (bb.e_)localObject1, null));
      }
      Collections.sort(this.b);
      label248:
      Object localObject1 = new lb();
      ((lb)localObject1).a(new bb.d_(-1.797693134862316E+308D, -1.797693134862316E+308D, null));
      ((lb)localObject1).a(new bb.d_(1.7976931348623157E+308D, -1.797693134862316E+308D, null));
      HashSet localHashSet = new HashSet();
      int i = 0;
      int j = this.b.size();
      label486:
      label489:
      label504:
      do
      {
        if (i >= j) {
          break;
        }
        bb.e_ locale_ = (bb.e_)this.b.get(i);
        bb.d_ locald_1 = new bb.d_(locale_.d, locale_.b, null);
        lb.b_ localb_1 = ((lb)localObject1).c(locald_1);
        Object localObject2 = localb_1;
        if (m == 0) {
          if (locale_.a())
          {
            do
            {
              if (localObject2 == null) {
                break;
              }
              if (m != 0) {
                break label489;
              }
              if (k != 0) {
                break label486;
              }
              if (((bb.d_)((lb.b_)localObject2).c()).a >= locale_.e) {
                break;
              }
              bb.d_ locald_2 = (bb.d_)((lb.b_)localObject2).c();
              a(localHashSet, locale_, locald_2, Math.min(locale_.e, ((bb.d_)((lb.b_)localObject2).a().c()).a));
              localObject2 = ((lb.b_)localObject2).a();
            } while (k == 0);
            if (m != 0) {
              break label504;
            }
            localHashSet.add(locale_);
            if (m != 0) {
              continue;
            }
            if (k == 0) {
              break label631;
            }
          }
        }
        localHashSet.remove(locale_.a);
        localObject2 = ((lb)localObject1).c(new bb.d_(locale_.e, (0.0D / 0.0D), null));
        double d = ((bb.d_)((lb.b_)localObject2).c()).c;
        lb.b_ localb_2 = ((lb)localObject1).a(localb_1, locald_1);
        if (m == 0) {
          if (localb_1.equals(localObject2)) {
            localObject2 = localb_2;
          }
        }
        lb.b_ localb_3 = ((lb)localObject1).a((lb.b_)localObject2, new bb.d_(locale_.e, d, null));
        if (m == 0)
        {
          if (!localb_2.a().equals(localb_3)) {
            ((lb)localObject1).a(localb_2.a(), localb_3.b());
          }
          i++;
        }
      } while (k == 0);
      label631:
    }
    
    private void a(HashSet paramHashSet, bb.e_ parame_, bb.d_ paramd_, double paramDouble)
    {
      int i1 = g.Cc;
      int n = g.Bc;
      double d1 = Math.max(parame_.d, paramd_.a);
      double d2 = parame_.b - paramd_.c;
      double d3 = paramDouble - d1;
      if ((i1 != 0) || ((d2 > b.q) && (d3 > b.q)))
      {
        ArrayList localArrayList = new ArrayList();
        bb.f_ localf_1 = new bb.f_(d1, true, null);
        localArrayList.add(localf_1);
        bb.f_ localf_2 = new bb.f_(paramDouble, false, null);
        localArrayList.add(localf_2);
        Iterator localIterator = paramHashSet.iterator();
        if (localIterator.hasNext()) {}
        while (i1 != 0)
        {
          bb.e_ locale_ = (bb.e_)localIterator.next();
          localArrayList.add(new bb.f_(locale_.d, true, null));
          localArrayList.add(new bb.f_(locale_.e, false, null));
          if (i1 != 0) {
            break label209;
          }
          if (n != 0) {
            break label208;
          }
          if (n == 0) {
            break;
          }
        }
        Collections.sort(localArrayList);
        label208:
        label209:
        int i = 0;
        double d4 = (0.0D / 0.0D);
        int j = 0;
        int k = 0;
        int m = localArrayList.size();
        label390:
        label418:
        do
        {
          if (k >= m) {
            break;
          }
          bb.f_ localf_3 = (bb.f_)localArrayList.get(k);
          if (i1 == 0) {
            if (localf_3.equals(localf_1))
            {
              i = 1;
              d4 = d1;
              if (i1 != 0) {
                continue;
              }
              if (n == 0) {
                break label418;
              }
            }
          }
          if (i1 == 0) {
            if (localf_3.equals(localf_2))
            {
              if (i1 == 0)
              {
                if (j != 0) {
                  break;
                }
                a(paramd_.c, d4, d2, paramDouble - d4);
              }
              if ((i1 == 0) && (n == 0)) {
                break;
              }
            }
          }
          if (i1 == 0)
          {
            if (localf_3.c)
            {
              if (i1 == 0)
              {
                if (j == 0)
                {
                  if (i1 != 0) {
                    break label390;
                  }
                  if (i != 0) {
                    a(paramd_.c, d4, d2, localf_3.a - d4);
                  }
                }
                j++;
              }
              if (i1 != 0) {
                continue;
              }
              if (n == 0) {}
            }
            else
            {
              j--;
            }
          }
          else
          {
            if (i1 != 0) {
              continue;
            }
            if (j == 0) {
              d4 = localf_3.a;
            }
          }
          k++;
        } while (n == 0);
      }
    }
    
    private void a(o paramo, m paramm)
    {
      int k = g.Cc;
      int j = g.Bc;
      paramm.h();
      label191:
      do
      {
        if (!paramm.e()) {
          break;
        }
        a.d.w[] arrayOfw = b.b(paramo.n(paramm.a()).h());
        int i = 1;
        do
        {
          do
          {
            if (i >= arrayOfw.length) {
              break label191;
            }
            kb localkb = new kb(arrayOfw[(i - 1)].a, arrayOfw[(i - 1)].b, arrayOfw[i].a, arrayOfw[i].b);
            Rectangle2D localRectangle2D = b.a(localkb, bb.this.g.g());
            if (j != 0) {
              break;
            }
            if ((!this.c) || ((k != 0) || (!b.a(localkb.c(), localkb.f()))))
            {
              if (k != 0) {
                continue;
              }
              if (!this.c)
              {
                if (k != 0) {
                  continue;
                }
                if (!b.a(localkb.b(), localkb.e())) {}
              }
            }
            else
            {
              a(localRectangle2D);
            }
            i++;
          } while (j == 0);
          paramm.f();
        } while (k != 0);
      } while (j == 0);
    }
    
    private void a(o paramo, a.c.w paramw)
    {
      int k = g.Cc;
      int j = g.Bc;
      double d = Math.max(bb.this.g.f(), bb.this.g.g());
      k localk = paramo.c(i.c);
      paramw.h();
      label159:
      label343:
      label349:
      label351:
      do
      {
        if (!paramw.e()) {
          break;
        }
        e locale = paramw.d();
        zc localzc = paramo.d(locale);
        Rectangle2D localRectangle2D = b.a(localzc.a(), localzc.b(), localzc.c(), localzc.d(), d);
        if (k == 0)
        {
          if (localk != null)
          {
            if (k != 0) {
              break label159;
            }
            if (localk.getBool(locale)) {}
          }
          else
          {
            a(localRectangle2D);
          }
        }
        else {
          if ((k == 0) && (j == 0)) {
            break label343;
          }
        }
        if (bb.this.i)
        {
          arrayOfkb = b.a(localzc);
          int i = 0;
          do
          {
            if (i >= arrayOfkb.length) {
              break;
            }
            a(b.a(arrayOfkb[i], bb.this.g.g()));
            i++;
            if (k != 0) {
              break label351;
            }
            if (j != 0) {
              break label349;
            }
          } while (j == 0);
        }
        kb[] arrayOfkb = b.a(localzc);
        if (k == 0)
        {
          if (k != 0) {
            continue;
          }
          if (this.c)
          {
            a(b.a(arrayOfkb[0], bb.this.g.g()));
            a(b.a(arrayOfkb[2], bb.this.g.g()));
            if (k == 0) {
              if (j == 0) {
                break label343;
              }
            }
          }
          else
          {
            a(b.a(arrayOfkb[1], bb.this.g.g()));
          }
        }
        a(b.a(arrayOfkb[3], bb.this.g.g()));
        paramw.f();
      } while (j == 0);
    }
    
    private void a(Rectangle2D paramRectangle2D)
    {
      if ((g.Cc != 0) || (this.a.intersects(paramRectangle2D)))
      {
        Rectangle2D localRectangle2D = this.a.createIntersection(paramRectangle2D);
        bb.e_ locale_ = this.c ? new bb.e_(localRectangle2D.getMinX(), localRectangle2D.getMinY(), localRectangle2D.getMaxY(), null) : new bb.e_(localRectangle2D.getMinY(), localRectangle2D.getMinX(), localRectangle2D.getMaxX(), null);
        this.b.add(locale_);
        this.b.add(new bb.e_(this.c ? localRectangle2D.getMaxX() : localRectangle2D.getMaxY(), locale_, null));
      }
    }
    
    private void a(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
    {
      int i = g.Cc;
      if ((i != 0) || (paramDouble3 >= b.q))
      {
        if (i == 0)
        {
          if (paramDouble4 < b.q) {
            return;
          }
          if (i != 0) {}
        }
        else if (this.c)
        {
          if (i != 0) {
            break label73;
          }
          b(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
          if (g.Bc == 0) {
            return;
          }
        }
        label73:
        b(paramDouble2, paramDouble1, paramDouble4, paramDouble3);
      }
    }
    
    protected abstract void b(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.l.bb

 * JD-Core Version:    0.7.0.1

 */